#!/usr/bin/env node

const http = require('https');

const addr = 'https://www.baidu.com';

http.get(addr,(res)=>{
  console.log('打印 “协议”  “状态码” “状态信息”：');
  console.log(`HTTP/${res.httpVersion}  ${res.statusCode}  ${res.statusMessage}`);
  console.log('打印请求头：');
  console.log(res.headers);
  console.log();
  console.log('打印请求：');
  res.pipe(process.stdout);
});
